﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

    public partial class MasterPage : System.Web.UI.MasterPage
    {
        private ConnectUnit conn = new ConnectUnit("localhost", "sa", "sa", "FlyWaySystem");
        protected void txtLogin_Click(object sender, EventArgs e)
        {
            String Password = txtPassword.Text;
            String Email = txtEmail.Text;
            if (Password == "" || Email == "")
            {
                txtEmail.Focus();
            }
            else { 
                DataSet ds = conn.Select("CustomerInfomation","EmailID='"+ Email +"' and Password='"+Password+"'");
                Boolean x = conn.getRowCount(ds) > 0;
                if (x) {
                    MessageBox.Show("Đăng nhập thành công!");
                }
                else MessageBox.Show("Sai thông tin đăng nhập"); 
            }
        }
    }
